import request from '@/config/axios'

export interface TenantApproveListVO {
  id: number
  corpName: string
  contactName: string
  contactMobile: string
  adminUser: string
  adminUserPass: string
  callCostPrice: number
  callChannel: number
  accountNum: number
  agentNum: number
  speech: string
  remark: string
  createTenantId: number
  handleStatus: number
  operator: number
}

// 查询开户申请记录列表
export const getTenantApproveListPage = async (params) => {
  return await request.get({ url: `/system/tenant-approve-list/page-by-admin`, params })
}

// 查询开户申请记录详情
export const getTenantApproveList = async (id: number) => {
  return await request.get({ url: `/system/tenant-approve-list/get-by-admin?id=` + id })
}

// 新增开户申请记录
export const createTenantApproveList = async (data: TenantApproveListVO) => {
  return await request.post({ url: `/system/tenant-approve-list/create`, data })
}

// 审核
export const approveTenantApproveList = async (data: TenantApproveListVO) => {
  return await request.post({ url: `/system/tenant-approve-list/approve`, data })
}
// 新增开户申请记录并创建租户
export const handleTenantApproveList = async (id) => {
  return await request.post({ url: `/system/tenant-approve-list/handle-create?id=${id}` })
}

// 修改开户申请记录
export const updateTenantApproveList = async (data: TenantApproveListVO) => {
  return await request.put({ url: `/system/tenant-approve-list/update`, data })
}

// 删除开户申请记录
export const deleteTenantApproveList = async (id: number) => {
  return await request.delete({ url: `/system/tenant-approve-list/delete?id=` + id })
}

// 导出开户申请记录 Excel
export const exportTenantApproveList = async (params) => {
  return await request.download({ url: `/system/tenant-approve-list/export-excel`, params })
}
